#!/usr/bin/env python
# -*- coding: utf-8 -*-

import wx
import time
import xmmsclient
import gui
import engine

class App(wx.App):
    def OnInit(self):
        Angel = engine.engine("Angie")
        
        if Angel.stateConnection == True:
            print "Connect to xmms2d            [OK]"
            self.xmms = gui.AngelGUI(None, -1, "")
            self.xmms.setAngel(Angel)
            self.xmms.Show()
            self.xmms.ml.run()
        else:
            dlg = wx.MessageDialog(None, 'El servidor xmms2 no se ha iniciado',
                               'Angel Player',
                               wx.OK | wx.ICON_INFORMATION
                               #wx.YES_NO | wx.NO_DEFAULT | wx.CANCEL | wx.ICON_INFORMATION
                               )
            dlg.ShowModal()
            dlg.Destroy()
        return True
                
def main():
    """
        main Angel
    """
    app = App()
    app.MainLoop()
    